fixed ref issue