created an exception if parameter is not passed