cleanup and updated for new url returned after auth