Attempted fix of retrieval code