catch errors on flow