Fix to create object directory properly