Working code till details view