fix drawing bug