fixed bug found by Sebastien