added error Handler