fixed bug due to ruby's hash tables