fix return in each method in Directory.java