clean up spaces of function validateForErrors