wrap unsafe vector function in IO