bug fix on window