added socket closed handling to serverRunnable