added fork() support for multiple connections