deleteFiles actions will delete folders also

fixed check for dirs array