added detail and end time query
end time