changed grid add function