little fix to ajax_get_related_entities