updating query
redirecting to home when finished