some error handlings