added resize handling