added resize and cleanup in move