added an exception if pattern matching doesnt find a match an exception is thrown