fixed mail
added test type logic