extend macro to run on batch