prepared v1.3
fixed issue when both start and end time are specified