add more guards against missing packages
declare functions and variables to suppress compiler warnings