Added check email function with main