fix fuction error