fixed bug in last