- Removed e.printStackTrace() in case of Exception and replace it with
System.err.println() and finally. 
- Corrected bad indentation.