Directory security

fixes #17