Modified resize JS script