add support for createing dir and check dir existence