Added spinner to indicate when querying and fixed bugs