fixed 'cannot split undefined' error