Polyline

Hello. I seem to have a problem with polyline tool as it is glitching. Everytime i erase what polyline did, when i select it again, the lines reappear. How do i fix this

@missingno1
Are you working on Bitmap layers or Vector Layers?

bitmap