fixed swap before complete bug