fix for public/gen directory creation race condition