cache mongo fix and functional test fix