fixed issues with authentication