small fix + small optimization