fixed a bug in leapfrog and draw