Added ip address validation with script termination.