fix bug for length(psi_mask)==1