fixed bugs, added a new option