Fix undefined error in challenges.js