make clickdetail function