adding missing return statements to error callbacks so further processing is stopped