Added check in get_groups method to avoid not existing topics groups in results