fixed some bugs with the maintenance work