adding update logic for mongo model