added close mechanism