fix reference to temp object error?