moved the websocekt listener to its correct location