changed duration to end time