Made database connections persistent and fixed status collection.