Remove System.exit for security reasons

Removed a System.exit considered to be apossible security vulnerability
Removed System.exit statements