improved checking