fixed fork logic