debugged assignment operator