Fixed query in ActivityController