Added a loader and updated query on change