many bug corrections