temp swap bug fixed