Fixed a bug where the swapped view was still visible