Reverted code that was making error in search