fixed bugs to address jquery resize issue