this also should probably throw an error rather than conditionally returning different sorts of objects