removing debug code and implementing server side mongo update fix