Update request.js

Fixed variable scope