fix for copying the wrong code back to graphicsdevice.