fix bug and add features