Added deinit2 function
home directory obtained by getenv(), works under sudo