Added Exception handling: InvalidArgumentException