Logic Error fixed