fix the canvasService.flip function