Changed a function that casued 503 error in a detail view.