fixed bug where connections werent closing