fix code where data wasn't being stored in mongo