fixed bug noticed by stak441