Added exception handling to application instantiation