added some code to better handle bug modifications