add safe macros