corrected spinner functionality