building user query and save'