Implemented log-in from DB