Problem could lie anywhere, but from your description, when you enter the data in the hash, check the code. Most likely you are overwriting information. Code same will help us to resolve it. You might also use debugger to examine the variables at various stages. Also use module