Fixed duplicate variable name
string to datetime comparison
Better "log" message