Fixed the loop to check if receiving a signal