Fixing get challenge function