improve binary checking