Add directory existence check back in and reorder installations