changed error exit code to macros