Fixing check function.