only a part of bug fixes