fixed NullPointerException in onDraw