added optional fork support