fixed segfault, both console and widget versions work perfectly. Todo: progress indication and exit by esc key, -s --silent option in console version