fixing demand /supply bug in script