updating the code with Mongo storage plugin