change pcntl_wait to pcntl_waitpid for latest php version to work