fix: throw error if init.origin is undefined