throwing InvalidArgumentsError for input validations