Code to fix the user logging system