fixed the before/after X/Xdot issue