added getpid to main