fixing algorithm for querying in camp status