added wsFrame encode method