add closeOnPop (needs testing)