Added spinner logic