fix js bug around use of "this"