added logging indirection in js