Partially working,[fails sometimes],inventory update logic has to be shifted, this is pending [1/0] switch logic