add detail view logic