working on err checking
error emails done?
re auth function