fixed bug with error message