changes to controller with query