Correcting screen refresh logic to ensure that app can be back grounded.