Added error handling for missing password token