Move incrementing of dir_count so that it can't get incremented