apply double buffering