Fixed variable use error for update_attributes call