Logical bug fixed