Bugfix: use directory rather than filename