Fixed mongodb connection leaks