trusted hosts are static. So creating a new instance will not preseve the current ones at the end. Please look at the code suggested by @fabpot in his comment