added function to detail.html