rename func, fix bug