fix #3619, segfault in resize!