fixed extract script