Query update and js fix