using waidpid with WNOHANG to handle background