use doSize to fix bug