bug in split function fixed