fix drawing function in graphic