fix bug for getEmergy