added non-interactive mode