extract SkipClose function