Added check to make sure token is validated