some error handling and version macros