changed macro to inline function