fix mapping to first and last record in cursor.