Adding in storing the status for query