added resize code