made response checking more pythonic