added loop to detect when qc ready to login