fix bug pointed out by quipo's review