optimises memory use and readded server connection