added loop through frames