add double buffer