cleaning data before it gets uploaded to mongo