fixed closing error