added close window status to context and added window to median filter