Somehow the jquery each function should be in one block