solved a part of bugs