Search query fails from curl