bunch of js to fix collapse menu