add directory existing check