Added security checks