fixed bug in ws connection