trying to added error check