fixed bug found by Dunno