Added $before checks