new conditional support for retrieval of patterns