fixing some bugs and add help