fix extract location to work as expected