adding check error code

adding check error code