fixed closing and re-opening