fixes problem displaying error label correctly