fix errors when drawing error text