working on auth and fixing global scope issue.