added keep-alive functionality
fixed conflict in connectionHandler