txlib each function improve