implement get im values and disconnect, fix free function in gen code