check for trailing slash on $datadir, remove it if found