add test and code for retriever