moved the title remove to  make the code slightly more efficient