fixed error message not showing properly