extension method for security