autodetect dir to run statistics script