Added auto change dir functionality