Fix restarting with mongodb