fixing error case