added code to take user back to the home state once the measurement completes