Added update query functionality