add edit function for category page