Changes for save the query correctly. We have to modify styles and minor changes yet.