fixed reference to lastrowid