fixes to downgrade for security