Database maintanence fix