fixed bugs in project switch code