functions fix up