add some security checks