Properly splitting string into array