login now works with database