add timestamp in logs

and fix sorting after a search