Removed unnecessary functions and fixed the wrong GUI being opened