Moving console log before calling callback.