Added error message rendering after validating input