fix various bug