fix afterlogic