fix the doesn't draw sometimes issue