helper function for copying frames