Return values of check function were wrong all along