Fixed the insert frames bug