Added fork control and pid