added check() to check current ip is correct