added error handle