fixed bug if cue is undefined