Fixing user authentication