added noninteractive mode