fixed extract bugs