Main menu button finally working properly with no memory leak