Added code for detail view