Revert "bug fix"

This reverts commit 450c30becb11ea814047368542cb262a1f2ea8f3.
Revert "Revert "bug fix""

This reverts commit ecbf78ad180fb1220a0aff1edd6e360a1715ac7c.