fixed some bugs at last added feature