make cleanup working correctly on mac