update script for directories