fix the loop for STEM