Change to be:

`if (!is_empty($namespace))`

Otherwise you can get unexpected behavior. Also, it's just cleaner :)