Fixed error connecting to DB and UI fix