added host key checking and hooks