Forgot to update sensors in inner while loop