fixing error messaging