added category if params[:id] is nil.