added ifs for categories