preparing the code for the use of websockets