fixes problems displaying error label correctly