logical bug fixed