fixed bugs in jar_main