Fix javascript search bug on heroku