separated inline function with try-catch, fixed path error