fixed logic for last grid element