Fixed menu collapse function