split funciton update for paths with spaces