fix problems with box-size in js calculations