changed execution order of the before callback
Merge pull request #764 from danwit/release-2-2-0

Changes execution order of the before callback.