Moved the friend function implementation from header to cpp file. - needed to enclose the friend function with the namespace.