Fixed updating bug for directory