added resize javascript