added spinner and gave functionality