added error handling in new character