add window support, and some fix