remove unecessary console.log
Change variable  declaration from dependent to independent to make it consistent with backend