make the play/pause working in loop mode