Aded rescues to check for errors