updated to fix search bug