only read proto file if needed