added pause state and next piece