added history interface, saving query history