initial input function for websocket