shell checks for terminated processes when a new bg process is started