upm: add protection around function for packaging