Added mkdir check