adding generic check functions, but mail is semi broken now