Replaced some return ES_ERROR/ ES_NORMAL with return