Fix error thrown before callback execution