handle eos and finalize playlist