fix dropdown and demo bugs and improve saveLastQuery