Added GetLastID function