fixing NPE on right click