fix giving undefined EC