implemented exceptions for incorrect parameter type, minor edit in the documentation