add fuction InsertFrame