Updated the code that handles conflicts