drawing state machine
added ws suppoert