fix crash when top row is occupied