fix bug in graphics