removed System.err and printStackTrace statements