fixing the errors and responses