use prepend_before_filter, closes #309