Fixed sendAll function