fixed new func bugs