catch errors and try again