finally fixed aliasing problems