fixed some bugs
minor changes