fix a bug in detail view