Fixing bug due a ws call