fix a typo and prevent function already defined errors.