fixing search by bin functions
fixing issue of search by bins being wrong