Fixed a bug in frame distribution