-Fix state issue with reference