fix #each behavior to only work on array