Fixed bugs of spinner displaying at the wrong time