changed the auto-refresh logic and added temporary print statements