fixing some bugs, maintenance