bug fix, thanks to Guy's example.