now checks case when registers and logs in, also users must have unique emails