fix javascript resize issue