fixed resizing crash issue