record last state when stopping recording macro
do not record empty macro