fix bug remove directory code