Fix  call method 'split' of undefined error