re-write to store status in DB and read from the DB for foreground display