Fixed the draw function.