Added fix for Invalid Token error handling