added trusted hosts check