corrected bug resize