fix miscalculation in psi attack function