fatal error corrected: %hash should not be global; global %hash caused problems that the next hash reference overwrite the previous one