correct type-checking for ws