Fix for the too many SQL connections error