fixing fs leaks - leading to too many open sockets