added condition to search hash where it must be shared