error handler callback added otherwise it wont call this function