Added more unit testing bug fix to controller in grid logic