changing `$isEmpty` is not the right approach because it gets overwritten a lot. Also, the patch needs tests