fixed some bugs, extended capabilities