modify js for automaticlly generate id