Fix for authentication bug