fixed logic bug in cached build