Use better way to get script path. Now works in cron jobs as well