ecode handling fix