move logging
check for bad path