fixed error messages helper