Fixed a bug in frame length