add spinner and functionality