Revert "possibly fixed a common TypeError"

This reverts commit 29bc326d29d5a1f33878a69315132ffc83507b72.
finally found the mistake causing ws to crash