fix beta reduction