guard against nonexistent profile panel when jumping into grammar.