fixing emrContext bug