fixed bug on last grid element