fig some bugs during debugging

- FIX : fix the method for writing substrate infor
- FIX : solve substrate only when the vertex is under gate