use isBareJid instead of getResourcePart().isEmpty()