should be working code for spinner