Added try/catch in main() for NullPointerException