fix ref cases