Fixed search script and added index script