added sanitizing code