Added a condition for non-interactive shelll access