updated login, fixed bugs