updated login functionality,  bug fixes