fixed directory structure & auto create dir if dir doesn't exist, removed
dependency on session!