some fixes with authentication