method for spinner