POS Toggle between Modes of payments dosen't change

In POS payment screen when I toggle between mode of payment the previous mode of payments amount does not turn to zero it shows the amount and if I type the amount in other modes of payment the total doubles. how can I fix this problem when I choose the other mode of payment option the previous one automatically turns to zero
erpNext v13.8.0
frappe v13.8.1