The structure of this callback seems kind of weird.... why the function returns values only if it has errors? Using return to prevent code from executing code is not usually a good practice. In this case, you should use an else in the if to achieve de same effect, INMHO.