added ability to replace memdb using list