optmialization bug fix :P