added exceptions for RangeError & ValueError