Fixed a bug in the getFrames() method