check basestring instead of str for makedirs also