Fix parenthesis location in endpoint check