rearranged the whole thing and got working again
more refactoring. sorted menu panel display