Fix possible bug of function redefinition