swap bug fixed