fixing bug and add funcation maintain subcatgory