Implementing LastInsertId method