keepPingOpen=false wip
moved interval into function
last commit before refactoring