Fixed bug in error handling