safer assignment logic, to protect against double-assignment