integrated callback mechanism to grid
changed function parameter to pass by value