save token to correct directory