Updated duration from CGFloat to NSTimeInterval