Added additional error handling for missing secret token