bugfix when trading