bug fix in error handling