javascript resize fix