Update p8, add some error handlings