asyc init ws code