fixed closing dir