Fixing bug with missing directory