updated code
fixed duration error