Fixed part of the bug