added the resizing function back