reverting change to use IndexError instead of validation since it does not raise an error for negative values