fixed before/after handling