refactor to popup play window (still buggy)