handled exceptions in main.java