fxed a bug in macro