After a lot of bug hunting, I finally fixed the bug where after loading another file, it would show another canvas