detect current dir