added check to login