Fix error message rendering in messages controller