functions fix