minor improvement to resize