Logical Error Fix