how to fix error message and the color of the errors?