fixed nullPointerException in getDrawGraphics()