added email validation + some other changes