correct index and add receive signal SIGUSR2