fixed the bug found by hyperax