close created file below deleteing directory