After a while of messing around with things i found out how to open and close it when i open another window