check length when adding frames