Replace error with logError