Move logError to the very top
Merge pull request #104 from Versal/fix/log-error-2

Move logError to the very top