test custom before function