Add error handling in queries runner