handleError put in closure bug fix