only if directory exists

Signed-off-by: Karl Merkli <info@karl-merkli.ch>