fixed a bug where the error message wasnt showing properly