fixed bug, crash while resizing