updated with query and showing to template