Removed unuseful System.err.println
Replaced System.err.println with exception