-fixed the database issues