Error in swap buffers fix