Added: Working replaceID function