check if entity is in any group before checking if it is in specific group (was NullPointerException)