more robust check for mtime