check size bounds