The invention is directed to an apparatus (10) and a method for preventing animals to enter or leave a separated area through an opening of the separated area. The invention comprises a grid (18) made from metal bars (40, 42), wherein the grid (18) is adapted to be energized and wherein the grid (18) forms an area with an upper side (20a to 20c) and a lower side (22a to 22c), and an electrically insulating material (24) arranged on the lower side (22a to 22c) of the grid (18), wherein the insulating material (24) is arranged to completely separate the grid (18) from a ground at least during horizontal arrangement of the grid (18) on a horizontal ground.