Your intelligence, your knowledge, does not help you change your habit energy. Only the practice of recognizing, embracing, and transforming can help. That is why the Buddha advised us to practice mindful breathing to recognize and take care of our habit energy as soon as it manifests. If you are capable of embracing your habit energy with the energy of mindfulness, then you are safe, you are not going to make the same mistake again.