Fix extract files logic

Change-Id: I6b963ff75be336a28f680f6dba61b53350c49283