correction to nullpointerexception in setDomain method
first tryouts in main method