uncomment while loop for monitoring stop signal