undefined functions fix