Added error code support