fixing drawing bug