fix temp variables for-loop