fixed some memory problems
Merge pull request #2 from pkit/auth

fixed some memory problems