better logic for checking username/email from db