added some count inputs and fixed detail view accordingly