Updated the sanitisation function to the new