put mkdir mothod out of if