Improve spinner, fix loop error