changed main function from host to dig