fix bug in autoresizing mask.