add detail logic