Fixed conditional error and added tokens to protected resource output