fixed some bugs in the interface.