fix a bug found by Koushik