Fix latest code after rewerting invalid commit