Moved spinner code to correc place