Added beginPath() to draw function