extend the io api and fix a bug in vio