Fixed toggle link styling
Create a function for logging errors