security checks

throw some exceptions