changed ifs to switch on "onPrepareOptionsMenu"