added check for existence of match in a collection as a repetitive method
fixed assign_wt to return false or return the actual query