Change the code to be based on title instead of counter