removed some bugs
merged