fixed login register errors in code