Well done for ruining your bud, you obviously didn't open the jar every other day to let some fresh air in.
In future add a peace of paper towel to the top of the jar and put on the lid, the slight gap created by the paper towel will allow JUST enough fresh air in that they will still cure fine and have no risk of mold.