canvas context is cleared before drawing