fix the detail view func