added spinner functionality