Fix check function