Added security checks.