fixed issues in non-interactive use