added resize and run loop