fixed login and db erros