improved error code