fix equality check in resize()