added auto update query