Formatting update and secure wrapper to email sql check