fixed search bug
added beforeHandler method