fixing error message rendering