- Moved '.split' to the correct side of the 'if'
- Check if the capabilities have been set before splitting