protect main routine against running code
when used as a library