add directory listener
add directory logic