fixed mission bug, apparently there are scoping rules in javascript