fixed code after changing the interface.