Fixing lastId Code
Fixing lastId Code