There should be no call to draw() anywhere in the function.