error handle
added error handler