fixed EMR bug