update setting and minor bugs fix