fixes for flag redirect on open and close