fixes reference issues with SM