only draw when necessary