logic fixes in jar_main