removed sleep from spinner function