fix scope error when callback not provided