fix pause bug