added window opening, closing, and refreshing