added training insert/update