various bug fixed