Data passed by pointer instead of value

performance fix