make endpoint reading a bit more robust