Fix for authentication returning incorrect value