add fork check in exception