fix swap
fix error for p_ is 0