bug fix for resize problem