fixed the device bug and draw is now more or less in the global game loop