changed execution order of the before callback