Minor code changes

- Added some logic to avoid auth_err 
- Removed some trace