Fixing bad call in error handling