Added multi-frame support