Setup login check function