Remove the need for this j=0, it seems unnecessary, instead you could do:
```
duration  = request.POST.getlist('duration')[0]
```