solved some HeadlessExceptions thrown while working without GUI