figured out the double buffer filling problem