nth from last is working fine