fixed many warnings about using the value of assignment operator