fixed SM_all bug