Fixed Logical Bug