attaches resize handler