query function and REPL started