update.php handles and inserts new elements from index