fix #each bug when input is a hash