handle the resize on a separate event