[fix] make directory optional