Fix: Cannot call method 'split' of undefined by ensuring a string exists before trying to split it