protected function createDir($path)
    {
        $status = false;

        if(!file_exists($path)) {

            $oldmask = umask(0);
            mkdir($path, 0755);
            umask($oldmask);

            // check if the directory is readable and writable
            $status = $this->changePermission($path);
        }
        else {
            $status = $this->changePermission($path);
        }

        return $status;

    }