use resize instead of assign