fixing issue with resize()