conditionally display context menu