modify get_next_id func in index.html