Fix allow function

Impossible to add more than one file/directory before this fix
Merge pull request #1 from marmotz/master

Fix allow function