overloaded operator functioning after adding declaration to header file