close primus only if exists