introduced error codes to client, fixed d1,d5.