updated spinner code