fix reference return issue