updated the error codes and the code accordingly