Modified exception if parameters are not valid