How do I avoid such issues in the future?

Updated